﻿@{
    Layout = "~/Views/Shared/_LayoutMain.cshtml";
    ViewBag.Title = "网非e学院--我的课程";
    var courseList = ViewBag.CourseList as List<XZL.Web.Da.Proc_UserCourse_MyCourseListResult>;
    var payList = ViewBag.PayList as List<XZL.Web.Da.Proc_UserCourse_MyCourseListResult>;
    var getList = ViewBag.GetList as List<XZL.Web.Da.Proc_UserCourse_MyCourseListResult>;
}

<div class="ci_Title">
    <span class="hp_TypeNav  hp_TypeNavSel">正在学</span>&nbsp;|
    <span class="hp_TypeNav">赠送课程</span>&nbsp;|
    <span class="hp_TypeNav">收到课程</span>
</div>

<div class="myCourseList">
    @foreach (var item in courseList)
    {
        <div class="courseBG" onclick="document.location = '../../Course/CourseInfo?CourseID=@item.CourseID&InviteID=@ViewBag.InviteID'">
            <div class="courseItem">
                <img src="@item.CourseImg" class="courseImg" />
                <span class="courseText">
                    <span class="courseTitle">
                        @item.CourseName
                    </span><br />
                    <span>
                        开课时间：@Convert.ToDateTime(item.StartTime).ToString("MM/dd hh:mm")
                    </span><br />
                    <span>
                        @item.TeacherName | @item.TeacherTitle1
                    </span><br />
                    <span>
                        @item.TeacherTitle2
                    </span>
                </span>
            </div>
        </div>
    }
</div>
<div class="myCourseList" style="display:none;">
    @foreach (var item in payList)
    {
        <div class="courseBG" onclick="document.location = '../../Course/GiveCourse?CourseID=@item.CourseID&OrderID=@item.OrderID&InviteID=@ViewBag.InviteID'">
            <div class="courseItem">
                <img src="@item.CourseImg" class="courseImg" />
                <span class="courseText">
                    <span class="courseTitle">
                        @item.CourseName
                    </span><br />
                    @if(item.GetUserName =="" || item.GetUserName==null)
                    {
                    <span>
                        暂未领取
                    </span>
                    }
                    else
                    {
                    <span>
                        领取人：@item.GetUserName<br />@item.CreateTime
                    </span>
                    }
                </span>
            </div>
        </div>
    }
</div>
<div class="myCourseList" style="display:none;">
    @foreach (var item in getList)
    {
        <div class="courseBG" onclick="document.location = '../../Course/CourseInfo?CourseID=@item.CourseID&InviteID=@ViewBag.InviteID'">
            <div class="courseItem">
                <img src="@item.CourseImg" class="courseImg" />
                <span class="courseText">
                    <span class="courseTitle">
                        @item.CourseName
                    </span><br />
                    <span>
                        赠送人：@item.PayUserName <br />@item.CreateTime
                    </span>
                </span>
            </div>
        </div>
    }
</div>

<script>
    //课程列表通过图片计算显示大小
    var courseHight = ($(".courseImg").eq(0).width()) * 4 / 5;
    $(".courseItem").height(courseHight);
    $(".courseImg").height(courseHight);
    $(".courseText").height(courseHight);

    //底部导航选中
    $("#ImgWode").attr("src", "../../Image/logoWodeSel.png");

    //导航切换
    $(".hp_TypeNav").click(function () {
        var num = $(".hp_TypeNav").size();
        var ind = $(".hp_TypeNav").index(this);
        $(".hp_TypeNav").removeClass("hp_TypeNavSel");
        $(".hp_TypeNav").eq(ind).addClass("hp_TypeNavSel");
        $(".myCourseList").hide();
        $(".myCourseList").eq(ind).show();
    })
</script>
